/* eslint-disable no-var */
'use strict';

const Controller = require('egg').Controller;

class ListController extends Controller {
  async index() {
    var { ctx } = this;
    const { m } = ctx.params;
    const res = await ctx.service.movies.find(m);
    if (res.length) {
      ctx.body = {
        status: 200,
        msg: m,
        res,
      };
    } else {
      ctx.body = {
        status: 400,
        msg: '输入api参数不合法',
      };
    }
  }
}

module.exports = ListController;
